import random

from gxl_ai_utils.utils import utils_file

data_config_path, tmp_file_path = utils_file.do_get_commandline_param(2)

data_info_dict = utils_file.load_dict_from_yaml(data_config_path)
total_list = []
for data_info in data_info_dict.values():
    data_path_i = data_info['path']
    data_weight = int(float(data_info['weight']))
    final_data_list_i = utils_file.load_list_file_clean(data_path_i) * data_weight
    total_list.extend(final_data_list_i)
# random.shuffle(total_list)
utils_file.write_list_to_file(total_list, tmp_file_path)
